home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Amiga Format CD 31
/
Amiga Format CD31 (1998-09-02)(Future Publishing)(GB)(Track 1 of 2)[!][issue 1998-10].iso
/
-seriously_amiga-
/
misc
/
fblit
/
programmers_note.doc
< prev
next >
Wrap
Text File
|
1998-07-16
|
3KB
|
56 lines
This is just a short ramble for people who think their software might
benefit from FBlit.
Taking advantage of fblit is simply a matter of putting data in fast ram
instead of chip. Intuition images can be kept in, and rendered from, fast
mem. Bitmaps can also have planes in fast mem and still be blitted through
the OS into a window. The downside is that you cannot use the OS to render
into a fast ram bitmap. There will be some OS routines you can use on a
fast bitmap(rastport), but any that use the blitter (other than 'BltBitMap'
etc.) will fail.
SuperBitMap windows seem to work with fast bitmaps, but again, many gfx.lib
etc. routines will not work...
Wether or not FBlit can do anything usefull for you obviously depends on
what your programme is about. It is irrelevent for non-OS software BTW. The
main benefits come when dealing with pre-rendered graphics, or those
generated without the OS(blitter). These can generally be kept/generated in,
and handled through the OS from fast ram, in exactly the same way you would
normally do it in chip mem. The only thing the programme needs to do is to
put the structures in fast ram instead of chip, and the only noticeable
difference should be reduced chip mem use and increased speed.
I have been asked for the WBTunnel source as a demonstration, but it really
is such a mess, and the relevent technique is so simple that it is easier
just to describe what it does here. It renders into an intuition image and
then calls 'DrawImage' to put the image in the window. The 'RTG' switch
defines wether the image structure should be allocated in chip or fast
memory. That's all there is. It is in fact 100% OS legal software, at least
while it's intuition image structure is in chip ram.
There is only one way a programme can directly interact with fblit, that is
by changing your task name to 'FBLITPLANES'. Any task with that name will
(probably!) get (non-displayable) bitmaps with planes allocated in fast ram
when calling 'AllocBitMap'. There are some dangers in this behaviour eg. if
a task with that name owns a window, the OS may allocate bitmaps in fast
mem when your window is overlapped etc. and cause corruption. I haven't
tried this, but it is likely that the task name must be changed to
'FBLITPLANES', the allocation done and the name changed back within a
forbid/permit if the task has any OS GUI at the time. This behaviour is
really just a relatively easy/transparent method for getting a bitmap with
planes in fast mem, on condition that fblit is running, or a normal chip
bitmap otherwise. ('FBLITPLANES' is simply a task name that is included in
the 'FAllocBitMap' promotion list by default, the effect of using this task
name is just the same as if a user adds your task name to the list...)
So, this whole madcap scheme is basically supposed to allow the use of fast
ram for graphics data in a way that is both very easy and (sort of) OS
legal from the apps point of view. So long as the option exists for the
user to choose to have the graphics back in chip mem, the app ahould be
safe on any past/current/future compatible OS, RTG systems, and standard
(non-RTG) systems that aren't running fblit. Though, obviously, an app
could end up 'unrunable' on some systems if it has more gfx than can fit in
chip mem, or if it relies on speed/non-flicker...